package com.my.mapper;

import org.apache.flink.streaming.connectors.redis.common.mapper.RedisCommand;
import org.apache.flink.streaming.connectors.redis.common.mapper.RedisCommandDescription;
import org.apache.flink.streaming.connectors.redis.common.mapper.RedisMapper;

public class MyRedisMapperHash implements RedisMapper<String> {
    @Override
    public RedisCommandDescription getCommandDescription() {
        return new RedisCommandDescription(RedisCommand.HSET,"boy");
    }

    @Override
    public String getKeyFromData(String s) {
        return s.split(" ")[0];
    }

    @Override
    public String getValueFromData(String s) {
        return s.split(" ")[1];
    }


    public static MyRedisMapperHash getMapper(){
        return new MyRedisMapperHash();
    }
}
